package org.zk.ownTask.service.impl;

import java.util.Date;

import org.zk.ownTask.dao.TaskDao;
import org.zk.ownTask.dao.impl.TaskDaoImpl;
import org.zk.ownTask.domain.Task;
import org.zk.ownTask.exception.TaskException;
import org.zk.ownTask.service.TaskService;

import junit.framework.TestCase;

public class testTaskService extends TestCase {
	private TaskDao taskDao = new TaskDaoImpl();
	public void testSave() throws TaskException{
		Task task = new Task();
		task.setTitle("test");
		task.setDetails("this is the test");
		task.setCarryOutTime(new Date());
		
		TaskServiceImpl ts = new TaskServiceImpl();
		ts.setTaskDao(taskDao);
		
		Task t = ts.save(task);
		assertEquals(t.getTitle(), "test");
	}
}
